<?php
  require_once('shared.php');
  
  require_once('model/User.php');
  require_once('model/Question.php');
  require_once('model/Car.php');
  require_once('model/News.php');
  require_once('model/Category.php');
  require_once('model/Article.php');

  User::Install();
  Question:: Install();
  Car::Install();
  News::Install();
  Category:: Install();
  Article::Install();

  $root = new User();
  $root->Login('strangerAdmin');
  $root->SetPassword('test');
  $root->Status(USER_STATUS_ADMIN);
  $root->Name('Админисьратор');
  $root->Fname('Великий');
  $root->Telephone('02');
  $root->City('Бабруйск');
  $root->Save();
  echo "Admin user registered\n";

  echo "Question fish... ";
  $_SESSION['userid'] = $root->Id();
  Question:: CreateQuestionFish(20,10);
  echo "generated\n";

  echo "Car fish... ";
  Car::CreateCarFish(90);
  echo "generated\n";
  
  echo "News fish... ";
  News::CreateNewsFish(12);
  echo "generated\n";
  
  echo "Categoryes...";
  Category::CreateCategory();
  echo "generated\n";
  
    
  
/*  	TODO создать папки 
 *		/media/news
 *		/media/cars
 */
  

?>